<?php

use yii\db\Migration;
use yii\db\Schema;

/**
 * Class m181015_061030_ADD_FIELD_CUSTOMER
 */
class m181015_061030_ADD_FIELD_CUSTOMER extends Migration
{
    /**
     * {@inheritdoc}
     */
    public function safeUp()
    {
        $this->addColumn('{{customer}}', 'payment', Schema::TYPE_STRING. "(255) NULL COMMENT '付款条件' AFTER phone ");
        $this->addColumn('{{customer}}', 'en_payment', Schema::TYPE_STRING. "(255) NULL COMMENT '付款条件英文' AFTER payment ");

        $this->dropColumn('{{customer}}', 'day_time');
    }

    /**
     * {@inheritdoc}
     */
    public function safeDown()
    {
        echo "m181015_061030_ADD_FIELD_CUSTOMER cannot be reverted.\n";

        return false;
    }

    /*
    // Use up()/down() to run migration code without a transaction.
    public function up()
    {

    }

    public function down()
    {
        echo "m181015_061030_ADD_FIELD_CUSTOMER cannot be reverted.\n";

        return false;
    }
    */
}
